package com.bzframework.pro.entity;

import com.bzframework.pro.model.school.customer.SaleChannel;
import com.bzframework.pro.model.school.customer.SalePerson;
import com.bzframework.pro.model.school.customer.ShiftClass;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.hswebframework.ezorm.rdb.mapping.annotation.ColumnType;
import org.hswebframework.ezorm.rdb.mapping.annotation.DefaultValue;
import org.hswebframework.ezorm.rdb.mapping.annotation.JsonCodec;
import org.hswebframework.web.api.crud.entity.GenericEntity;
import org.hswebframework.web.crud.annotation.EnableEntityEvent;

import javax.persistence.Column;
import javax.persistence.Index;
import javax.persistence.Table;
import java.sql.JDBCType;
import java.util.List;

/**
 * @Author bingzhong
 * @Date 2025/3/21 10:46
 * @Description 客户接口数据
 */
@Table(name = "beiya_customer", indexes ={
        @Index(name = "idx_customer_id", columnList = "customer_id", unique = true),
        @Index(name = "idx_tan_ma_customer_id", columnList = "tan_ma_customer_id", unique = true)
})
@Getter
@Setter
@Schema(description = "客户接口数据")
@EnableEntityEvent //开启实体类crud事件
public class CustomerEntity extends GenericEntity<String> {

    @Column
    @Schema(description = "意向客户id")
    private String customer_id;

    /**
     * 为了适配 导入跟进记录
     */
    @Column
    @Schema(description = "探马客户意向客户id")
    private String tanMaCustomerId;

    @Column
    @Schema(description = "创建时间，格式yyyyMMddHHmmss")
    private String createtime;

    @Column
    @Schema(description = "更新时间，格式yyyyMMddHHmmss")
    private String updatetime;

    @Column
    @Schema(description = "录入时间，格式yyyyMMddHHmmss")
    private String inputDate;

    @Column
    @Schema(description = "有效性判定")
    private String valid;

    @Schema(description = "有效性判定")
    private String IsInvalid;

    @Column
    @Schema(description = "校区id")
    private String campus_id;

    @Column
    @Schema(description = "意向客户姓名")
    private String name;

    @Column
    @Schema(description = "英文姓名")
    private String english_name;

    @Column
    @Schema(description = "头像地址")
    private String photo_path;

    @Column
    @Schema(description = "身份证号码")
    private String idnumber;

    @Column
    @Schema(description = "性别（1男，2女，0未知）")
    private Integer sex;

    @Column
    @Schema(description = "公历生日，格式yyyyMMdd")
    private String birthday;

    @Column
    @Schema(description = "阴历生日，格式yyyyMMdd")
    private String birthday_moon;

    @Column
    @Schema(description = "家庭住址")
    private String address;

    @Column
    @Schema(description = "QQ号码")
    private String qq;

    @Column
    @Schema(description = "手机号码")
    private String smstel;

    @Column
    @Schema(description = "父亲姓名")
    private String father;

    @Column
    @Schema(description = "父亲电话")
    private String father_tel;

    @Column
    @Schema(description = "父亲职业")
    private String father_vocation;

    @Column
    @Schema(description = "母亲姓名")
    private String mother;

    @Column
    @Schema(description = "母亲电话")
    private String mother_tel;

    @Column
    @Schema(description = "母亲职业")
    private String mother_vocation;

    @Column
    @Schema(description = "其他联系方式")
    private String other_tel;

    @Column
    @Schema(description = "就读的全日制学校")
    private String fulltime_school;

    @Column
    @Schema(description = "就读的全日制学校班级名称")
    private String fulltime_class;

    @Column
    @Schema(description = "当前年级代码")
    private Integer grade_code;

    @Column
    @Schema(description = "输入年级时的基准日期，格式yyyyMMddHHmmss")
    private String grade_base_date;

    @Column
    @Schema(description = "客户来源id（已废弃）")
    private String sale_channel_id;

    @Column
    @ColumnType(javaType = String.class, jdbcType = JDBCType.LONGVARCHAR)
    @Schema(description = "客户来源id")
    private String sale_channel_ids;

    @Column
    @Schema(description = "销售人员Id")
    private String sale_person_id;

    @Column
    @Schema(description = "销售人员名称")
    private String sale_person_name;

    @Column
    @Schema(description = "探马销售人员Id")
    private String tanma_sale_person_id;

    @Column
    @Schema(description = "客户状态")
    private String customer_status;

    @Column
    @Schema(description = "转化状态(0未知，1转化成功)")
    private Integer transfer_status;

    @Column
    @Schema(description = "转化时间 格式yyyyMMddHHmmss")
    private String transfer_date;

    @Column
    @Schema(description = "学员id")
    private String student_user_id;

    @Column
    @Schema(description = "上次沟通类型Id")
    private String lastmode_id;

    @Column
    @Schema(description = "上次沟通日期 格式yyyyMMddHHmmss")
    private String last_date;

    @Column
    @ColumnType(javaType = String.class, jdbcType = JDBCType.LONGVARCHAR)
    @Schema(description = "上次沟通情况")
    private String last_content;

    @Column
    @Schema(description = "上次沟通人员Id")
    private String last_user_id;

    @Column
    @Schema(description = "下次跟进类型Id")
    private String nextmode_id;

    @Column
    @Schema(description = "下次跟进日期 格式yyyyMMddHHmmss")
    private String next_date;

    @Column
    @Schema(description = "意向级别")
    private Integer will_level;

    @Column
    @Schema(description = "试听状态")
    private Integer tryclass_status;

    @Column
    @Schema(description = "试听状态转换日期 格式yyyyMMddHHmmss")
    private String tryclass_date;

    @Column
    @ColumnType(javaType = String.class, jdbcType = JDBCType.LONGVARCHAR)
    @Schema(description = "备注")
    private String describe;

    @Column
    @Schema(description = "导入时间（批量导入的时间），格式yyyyMMddHHmmss")
    private String import_time;

    @Column
    @Schema(description = "创建记录的用户Id")
    private String create_user_id;

    @Column
    @Schema(description = "状态")
    private Integer status;

    @Column
    @Schema(description = "主联系人标识")
    private Integer defaultcontact;

    @Column
    @Schema(description = "意向课程id")
    private String will_shift_id;

    @Column
    @Schema(description = "预约试听时间")
    private String reservationtry_date;

    @Column
    @Schema(description = "账户Id")
    private String user_id;

    @Column
    @Schema(description = "是否回收客户 1是 0否")
    private Integer isrecycle;

    @Column
    @Schema(description = "回收时间 格式yyyyMMddHHmmss")
    private String recycle_time;

    @Column
    @Schema(description = "介绍人id")
    private String introducer_id;

    @Column
    @Schema(description = "其他客户来源 0是前台输入;1是导入;2是在线报名;3是学生秀")
    private Integer customer_from;

    @Column
    @Schema(description = "市场渠道")
    private String sale_market_id;

    @Column
    @Schema(description = "有效性 0无效 1有效 空无")
    private String effectiveness;

    @Column
    @JsonCodec
    @DefaultValue("[]")
    @ColumnType(javaType = String.class, jdbcType = JDBCType.LONGVARCHAR)
    @Schema(description = "客户来源id列表")
    private List<SaleChannel> sale_channel_list;

    @Column
    @JsonCodec
    @DefaultValue("[]")
    @ColumnType(javaType = String.class, jdbcType = JDBCType.LONGVARCHAR)
    @Schema(description = "副责任人id列表")
    private List<SalePerson> sale_person_list;

    @Column
    @JsonCodec
    @DefaultValue("[]")
    @ColumnType(javaType = String.class, jdbcType = JDBCType.LONGVARCHAR)
    @Schema(description = "意向课程列表")
    private List<ShiftClass> shift_class_list;

    @Column
    @Schema(description = "资源属性")
    private String field3;


}
